package laboratorio8;
//Universidad del Valle de Guatemala
//Kevin Godinez, 12717
//Samantha Catun, 12382
//Roger Artemio Diaz Fuentes, 12176
//Algoritmos y Estructuras de Datos
//Hoja de trabajo No.8

import java.util.*;

class HashTable implements WordSet{
	private Hashtable base;
        private int key;
	
	public HashTable(){
            base = new Hashtable();
            key = 0;
	}
	
	public Word get(Word word){
            Word wordActual;
            for(int x=0; x<base.size(); x++){
                wordActual = (Word) base.get(x);
                if(wordActual.getWord().equals(word.getWord())){
                    return wordActual;
                }
            }
            return null;
	}
	
	public void add(Word wordObject){
            base.put(key, wordObject);
            key++;
	}
}